import count from '@dfeidao/atom-nodejs/db/count';
import query from '@dfeidao/atom-nodejs/db/query';
interface Message {
	filter: {
		productid: string;
		package_no: string;
		code?: {}
	};
}

export default async function atom(msg: Message, action_id: string, session_id: string) {

	const { exec, prepare } = query(action_id, session_id, '11');
	prepare('pub_package_code', ['code', 'package_no', 'action_name', 'action_keyword', 'action_keyword'], msg.filter, 200, 1, [], []);
	const [data] = await exec();
	// 查询总条数
	const { exec: e, prepare: p } = count(action_id, session_id, '11');
	p('pub_package_code', msg.filter);
	const [_count] = await e();
	return { dataArray: data, count: _count };
}
